package gui.navigation;

import gui.MyFrame;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JPanel;

public class MainMenuGui extends JPanel {

	public MainMenuGui(final MyFrame myFrame) {
		this.setLayout(new GridLayout(5, 1));
		this.setPreferredSize(new Dimension(200, 300));
		JButton d2 = new JButton("2D geometry");
		d2.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setNavigationPanel(MyFrame.D2);
			}
		});
		this.add(d2);
		JButton d3 = new JButton("3D geometry");
		d3.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setNavigationPanel(MyFrame.D3);
			}
		});
		this.add(d3);
		JButton others = new JButton("Others");
		others.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setNavigationPanel(MyFrame.OTHERS);
			}
		});
		this.add(others);
		JButton saved = new JButton("Saved results");
		saved.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.SAVED);
			}
		});
		this.add(saved);
		JButton exit = new JButton("Exit");
		exit.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				System.exit(0);
			}
		});
		this.add(exit);
	}
}